import 'package:oramemo/generated/json/base/json_convert_content.dart';
import 'package:oramemo/entity/requst/device_put_entity.dart';

DevicePutEntity $DevicePutEntityFromJson(Map<String, dynamic> json) {
  final DevicePutEntity devicePutEntity = DevicePutEntity();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    devicePutEntity.id = id;
  }
  final String? deviceConfig = jsonConvert.convert<String>(
      json['deviceConfig']);
  if (deviceConfig != null) {
    devicePutEntity.deviceConfig = deviceConfig;
  }
  final String? deviceModel = jsonConvert.convert<String>(json['deviceModel']);
  if (deviceModel != null) {
    devicePutEntity.deviceModel = deviceModel;
  }
  final String? customModelId = jsonConvert.convert<String>(
      json['customModelId']);
  if (customModelId != null) {
    devicePutEntity.customModelId = customModelId;
  }
  return devicePutEntity;
}

Map<String, dynamic> $DevicePutEntityToJson(DevicePutEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['deviceConfig'] = entity.deviceConfig;
  data['deviceModel'] = entity.deviceModel;
  data['customModelId'] = entity.customModelId;
  return data;
}

extension DevicePutEntityExtension on DevicePutEntity {
  DevicePutEntity copyWith({
    String? id,
    String? deviceConfig,
    String? deviceModel,
    String? customModelId,
  }) {
    return DevicePutEntity()
      ..id = id ?? this.id
      ..deviceConfig = deviceConfig ?? this.deviceConfig
      ..deviceModel = deviceModel ?? this.deviceModel
      ..customModelId = customModelId ?? this.customModelId;
  }
}